package com.liuzy.beauty;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Bz81 extends Beauty {
	public static void main(String[] args) {
		new Bz81("D:\\beauty\\", "http://bz81.net/").start();
	}

	public Bz81(String saveDir, String startUrl) {
		super(saveDir, startUrl);
	}

	@Override
	public void search(String url, String html) {
		Matcher next = Pattern.compile("<a href=\"(http://.*?)\">").matcher(html);
		while (next.find()) {
			grilQueue.add(next.group(1));
		}
		Matcher jpg = Pattern.compile("src=\"(http://.*?.jpg)\" ").matcher(html);
		while (jpg.find()) {
			imageQueue.add(jpg.group(1));
		}
	}

	@Override
	public String reName(String url) {
		return url.substring(url.lastIndexOf("/") + 1);
	}

}
